package ru.st.selenium;

import static org.junit.Assert.assertTrue;

import org.testng.annotations.Test;

import ru.st.selenium.model.Film;
import ru.st.selenium.pages.TestBase;

public class AddNewFilm extends TestBase {
	String filmname = "film"+System.currentTimeMillis();
	@Test
	public void LoginOK() {
		app.getUserHelper().loginAs(ADMIN);
	}
	
	@Test
	public void AddNewFilmOK() {
		Film film = new Film()
			.setTitle(filmname)
			.setYear("1990");
		assertTrue(app.getFilmHelper().isAdd(film));
	 }
	@Test
	  public void AddNewFilmFailed() {
		Film film = new Film()
			.setTitle(filmname);
		assertTrue(app.getFilmHelper().isNotAdd(film));
	  }
	@Test
	public void  LogoutOK() {
		app.getUserHelper().logout();
	}
}
